#pragma once

#include "rulebase.h"

/**
 * This class makes a specific use of LongInstance objects. Instead of keeping the coordinates where the 
 * rule applies, it keeps the coordinates where the rule does NOT apply. This class also only keeps the 
 * rules (i.e. long instances) where the output is Black. If an IF part cannot be found in the object,
 * it will be considered to be a White pixel.
 */
class RuleBaseption
{
private:
	vector<LongInstance2> rules;
	/** Returns true if the given coordinate is an element of rule::coordinate. Here they are threated as exceptions for the rule.*/
	bool cooIsException (const LongInstance2& rule, const Coordinate& coo) const;

public:
	RuleBaseption();
	RuleBaseption (const RuleBaseption& other);
	RuleBaseption (const RuleBase& rb);
	RuleBaseption& operator= (const RuleBaseption& other);
	/** Creates the next layer Image in the eim according to the history of previous layers and the rules in this object. */
	void advanceEIM (EightLayerIM& eim) const;

	int getFeatureSize() const;
	/**
	 * Returnes the net information size (in bits) stored in an object.
	 * The returned value is the minimum number of bits that efficiently can give us all the information
	 * in an object.
	 */
	int getNetInfoSizeInBits(void);

	int getRulesNum () const;
};